package com.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

@Configuration
public class RmiService {
    @Autowired
    private Environment environment;

//    @Bean
//    public RmiProxyFactoryBean personService(){
//        RmiProxyFactoryBean rmiProxyFactoryBean = new RmiProxyFactoryBean();
//        rmiProxyFactoryBean.setServiceInterface( IPersonService.class );
//        StringBuffer rmiServiceURI = new StringBuffer("rmi://"  );
//        rmiServiceURI.append( environment.getProperty( "rmi.serviceHost" ,"127.0.0.1") ).append( ":" );
//        rmiServiceURI.append( environment.getProperty( "rmi.servicePort" ,"1099") );
//        rmiServiceURI.append("/" ).append( "personService" );
//        rmiProxyFactoryBean.setServiceUrl( rmiServiceURI.toString() );
//        rmiProxyFactoryBean.setRefreshStubOnConnectFailure( true );
//        rmiProxyFactoryBean.setLookupStubOnStartup( false );
//        return  rmiProxyFactoryBean;
//    }

}
